package com.github.data_manage.domain.vo

import com.github.data_manage.domain.dto.PersonRelationDto
import org.springframework.format.annotation.DateTimeFormat
import java.math.BigDecimal
import java.time.LocalDate

/**
 *@author CHN
 *@since 2024-08-11 11:10
 */
data class PersonRelationVo(
    val personId: Int,
    val name: String,
    val fundRelations: List<PersonFundRelationVo>,
    val investmentRelations: List<PersonInvestmentRelationVo>,
    val friends: List<PersonRelationDto>,
    val colleagues: List<PersonCompanyRelationVo>,
    val schoolMates: List<PersonSchoolRelationVo>
) {
}

data class PersonFundRelationVo(
    val fundId: Int,
    val fundName: String,
    // 职位
    val position: String?,

    // 入职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val startDate: LocalDate?,

    // 离职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val endDate: LocalDate?,
)

data class PersonInvestmentRelationVo(
    val investmentId: Int,
    val investmentName: String,
    // 规模
    val aum: BigDecimal?,
    // 投资占比
    val scale: BigDecimal? = null,
    // 投资金额
    val amount: BigDecimal? = null,
    // 开始时间
    val startDate: String?,

    // 结束时间
    val endDate: String?
)


data class PersonSchoolRelationVo(
    val schoolId: Int,
    val schoolName: String,
    // 专业
    val specialized: String?,

    // 入职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val startDate: LocalDate?,

    // 离职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val endDate: LocalDate?,
    val schoolmates: List<PersonSchoolMateRelationVo>
)

data class PersonCompanyRelationVo(
    val companyId: Int,
    val companyName: String,
    // 职位
    val position: String? = null,

    // 地点
    val address: String? = null,

    // 入职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val startDate: LocalDate? = null,

    // 离职时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    val endDate: LocalDate? = null,

    val note: String? = null,
    val colleagues: List<PersonColleagueRelationVo>
)

data class PersonColleagueRelationVo(
    val personId: Int,
    val personName: String,
    val startDate: LocalDate?,
    val endDate: LocalDate?,
    val note: String?,
    val level: Int = 2
)

data class PersonSchoolMateRelationVo(
    val personId: Int,
    val personName: String,
    // 专业
    val specialized: String?,
    val startDate: LocalDate?,
    val endDate: LocalDate?,
    val note: String?,
    val level: Int = 2
)
